﻿using System.ServiceModel.Syndication;
using RecruitmentAgency.Models.DataTypes;
using System.Collections.Generic;

namespace RecruitmentAgency.Models.DataProviders
{
    /// <summary>
    /// Interface defining the Job's methods for the database access
    /// </summary>
    public interface IJobDataProvider
    {
        /// <summary>
        /// Add a job to the database
        /// </summary>
        /// <param name="job">The job instance containing all the data relevant to the job</param>
        void AddJob(Job job);

        /// <summary>
        /// Delete a job from the database
        /// </summary>
        /// <param name="jobId">The Id of the job to delete</param>
        void DeleteJob(int jobId);

        /// <summary>
        /// Gets a System.ServiceModel.Syndication.SyndicationFeed full of Job data
        /// </summary>
        /// <param name="homePageUri">The URI of the page to go to when the user clicks the RSS feed title link</param>
        /// <returns>A System.ServiceModel.Syndication.SyndicationFeed full of Job data</returns>
        SyndicationFeed GetJobRssFeed(string homePageUri);

        /// <summary>
        /// Gets the Job instance that relates to the provided jobId
        /// </summary>
        /// <param name="jobId">The ID number of the job whose personal details are required</param>
        /// <returns>A PersonalDetail instance</returns>
        Job GetJob(int jobId);

        /// <summary>
        /// Gets the job search results and paging data
        /// </summary>
        /// <param name="pageSize">The number of rows of results to a page</param>
        /// <param name="pageNumber">The number of the page of results to return</param>
        /// <param name="jobTitle">The job title to search for</param>
        /// <param name="jobDescription">The job description to search for</param>
        /// <param name="closingDate">The closing date to search for</param>
        /// <param name="jobSector">The job sector to search for</param>
        /// <returns>A JobSearchData instance that holds the Job results and paging data</returns>
        JobSearchData SearchJobs(int pageSize, int pageNumber, string jobTitle, string jobDescription, string closingDate, string jobSector);

        /// <summary>
        /// Update a job in the databse
        /// </summary>
        /// <param name="job">The job instance containing all the job details</param>
        void UpdateJob(Job job);

        /// <summary>
        /// Gets unique job titles from the database
        /// </summary>
        /// <returns>A list of unique job titles</returns>
        List<string> GetUniqueJobTitles();

        /// <summary>
        /// Gets unique job sectors from the database
        /// </summary>
        /// <returns>A list of unique job sectors</returns>
        List<string> GetUniqueJobSectors();
    }
}